package com.lingx.model.impl;

import com.alibaba.fastjson.annotation.JSONField;
import com.lingx.model.IInterpreter;
import com.lingx.model.INode;
import com.lingx.model.IValidator;
import com.lingx.model.annotation.FieldModelConfig;
import com.lingx.model.annotation.TreeNode;

public class DefaultField extends AbstractModel{

	private static final long serialVersionUID = -5187521092879251326L;
	public DefaultField() {
		this.setCode("");
		this.setName("");
		this.setModelType("Field");
		this.setIconCls("el-icon-sugar");
		//this.setInterpreters(new DefaultNode<IInterpreter>("解释器"));
		//this.setValidators(new DefaultNode<IValidator>("验证器"));
	}
	@FieldModelConfig(sort="11",name="属性代码",inputType="string")
	private String code;
	
	@FieldModelConfig(sort="22",name="属性名称",inputType="string")
	private String name;
	@FieldModelConfig(sort="3",name="值",inputType="string",editor="hidden")
	private Object value;
	//@FieldModelConfig(sort="4",name="数据类型",inputType="string",editor="new Ext.form.field.ComboBox({displayField: 'text',valueField: 'value',store: new Ext.data.Store({proxy:{ model:'Option',type:'ajax',url:'e?e=tlingx_option&m=items&lgxsn=1&code=SJKLX',reader:{type:'json'}},autoLoad:true})}) ")//e?e=toption&m=items&lgxsn=1&code=BJKKJ
	//private String type;//数据库中的类型
	//@FieldModelConfig(sort="5",name="长度",inputType="number")
	//private String length;//长度
	@FieldModelConfig(sort="6",name="不可为空",inputType="string",editor="boolean")
	private Boolean isNotNull=false;

	@FieldModelConfig(sort="7",name="输入控件",inputType="string",editor="combobox",editorParams="option:BJKKJ")//e?e=toption&m=items&lgxsn=1&code=BJKKJ
	private String inputType="textfield";//指定输入控件
	@FieldModelConfig(sort="8",name="控件参数",inputType="string")
	private String inputOptions;//输入控件的参数
	@FieldModelConfig(sort="9",name="引用类型",inputType="string",editor="combobox",editorParams="option:YYLX")//,{\"text\":\"无\",\"value\":\"\"},
	private String comboType;//1为输入，2为显示
	@FieldModelConfig(sort="A",name="指向实体模型",inputType="string",editor="combobox",editorParams="editorParams_1")//e?e=tlingx_entity&m=combo&is_ref=1&lgxsn=1
	private String refEntity;//指向哪个实体【数据库表】
	
	@FieldModelConfig(sort="B",name="是否可用",inputType="string",editor="boolean")
	private Boolean enabled=true;
	@FieldModelConfig(sort="C",name="是否可见",inputType="string",editor="boolean")
	private Boolean visible=true;
	@JSONField(serialize=false)
	@FieldModelConfig(sort="D",name="字段同步",inputType="string",editor="boolean")
	private Boolean fieldSynchro=true;
	@JSONField(serialize=false)
	@FieldModelConfig(sort="E",name="默认值",inputType="string")
	private String defaultValue="";

	@FieldModelConfig(sort="F",name="列表宽度",inputType="string")
	private String width="";
	
	//@JSONField(serialize=false)
	@FieldModelConfig(sort="G",name="是否转义",inputType="string",editor="boolean")
	private Boolean escape=true;
	
	//@JSONField(serialize=false)
	@FieldModelConfig(sort="H",name="是否连接",inputType="string",editor="boolean")
	private Boolean isEntityLink=true;
	/*
	@FieldModelConfig(sort="I",name="表单栅格",inputType="string")
	private String formClass;
	@FieldModelConfig(sort="J",name="标签栅格",inputType="string")
	private String formClass1;
	@FieldModelConfig(sort="K",name="控件栅格",inputType="string")
	private String formClass2;
	*/
	//@TreeNode
	//private INode<IConfig> configs;
	
	@FieldModelConfig(sort="X",name="关联验证器",inputType="string",editor="combobox",editorParams="editorParams_2")//e?e=tlingx_entity&m=combo&is_ref=1&lgxsn=1
	private String validator;//指向哪个实体【数据库表】

	@FieldModelConfig(sort="Y",name="验证器参数",inputType="string")
	private String validatorParams="";
	
	@FieldModelConfig(sort="Z",name="关联解释器",inputType="string",editor="combobox",editorParams="editorParams_3")//e?e=tlingx_entity&m=combo&is_ref=1&lgxsn=1
	private String interpreter;//指向哪个实体【数据库表】
	/*
	@JSONField(serialize=false)
	@TreeNode
	private INode<IValidator> validators;
	@JSONField(serialize=false)
	@TreeNode
	private INode<IInterpreter> interpreters;
	*/
	private Object optionitem;
	
	public Object getOptionitem() {
		return optionitem;
	}
	public void setOptionitem(Object optionitem) {
		this.optionitem = optionitem;
	}
	public String getCode() {
		return code;
	}
	public void setCode(String code) {
		this.code = code;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public Object getValue() {
		return value;
	}
	public void setValue(Object value) {
		this.value = value;
	}
	public Boolean getIsNotNull() {
		return isNotNull;
	}
	public void setIsNotNull(Boolean isNotNull) {
		this.isNotNull = isNotNull;
	}
	public String getInputType() {
		return inputType;
	}
	public void setInputType(String inputType) {
		this.inputType = inputType;
	}
	public String getInputOptions() {
		return inputOptions;
	}
	public void setInputOptions(String inputOptions) {
		this.inputOptions = inputOptions;
	}
	public String getComboType() {
		return comboType;
	}
	public void setComboType(String comboType) {
		this.comboType = comboType;
	}
	public String getRefEntity() {
		return refEntity;
	}
	public void setRefEntity(String refEntity) {
		this.refEntity = refEntity;
	}
	public Boolean getEnabled() {
		return enabled;
	}
	public void setEnabled(Boolean enabled) {
		this.enabled = enabled;
	}
	public Boolean getVisible() {
		return visible;
	}
	public void setVisible(Boolean visible) {
		this.visible = visible;
	}
	public Boolean getFieldSynchro() {
		return fieldSynchro;
	}
	public void setFieldSynchro(Boolean fieldSynchro) {
		this.fieldSynchro = fieldSynchro;
	}
	public String getDefaultValue() {
		return defaultValue;
	}
	public void setDefaultValue(String defaultValue) {
		this.defaultValue = defaultValue;
	}
	public String getWidth() {
		return width;
	}
	public void setWidth(String width) {
		this.width = width;
	}
	public Boolean getEscape() {
		return escape;
	}
	public void setEscape(Boolean escape) {
		this.escape = escape;
	}
	public Boolean getIsEntityLink() {
		return isEntityLink;
	}
	public void setIsEntityLink(Boolean isEntityLink) {
		this.isEntityLink = isEntityLink;
	}
	public String getValidator() {
		return validator;
	}
	public void setValidator(String validator) {
		this.validator = validator;
	}
	public String getInterpreter() {
		return interpreter;
	}
	public void setInterpreter(String interpreter) {
		this.interpreter = interpreter;
	}
	public String getValidatorParams() {
		return validatorParams;
	}
	public void setValidatorParams(String validatorParams) {
		this.validatorParams = validatorParams;
	}


	
	
}
